namespace ICSharpCode.TextEditor.Formatting
{
    public class FormattingStrategyFactory
    {
        public static IFormattingStrategy Create(string extension)
        {
            IFormattingStrategy result = new StringFormatStrategy();
            switch (extension.ToUpper())
            {
                case "XML":
                    result = new XmlFormattingStrategy();
                    break;
                case "JAVASCRIPT":
                case "JAVA":
                    result = new JavascriptFormatStrategy();
                    break;
                case "JSON":
                    result = new JsonFormatStrategy();
                    break;
                case "HTML":
                    result = new HtmlFormatStrategy();
                    break;
                case "ASP/XHTML":
                case "CSHTML":
                    result = new AspxFormatStrategy();
                    break;
                case "CSS":
                    result = new CssFormatStrategy();
                    break;
                case "SQL":
                    result = new TsqlFormattingStrategy();
                    break;
                case "C#":
                    result = new CSharpFormatStrategy();
                    break;
            }
            return result;
        }
    }
}
